chrome.contextMenus.create({
    title: '查询该留言手机、IP信息', //菜单的名称
    id: '1',//二级菜单的id
    contexts: ['all'],
    //只允许固定url展示
    documentUrlPatterns: ['https://wz.mala.cn/wz/wzinfo?wid=*'],
});
chrome.contextMenus.onClicked.addListener((menuInfo, tab) => {
    //判断是否登录
    var useradmin_token = "chrome_admin_token"
    console.log(tab)
    chrome.storage.local.get().then((res) => {
        if(res[useradmin_token]){
            chrome.tabs.sendMessage(tab.id, {'action':'lookwz'}, function(response) {});
        }else{
            chrome.action.openPopup()
        }
    })
    if(menuInfo.menuItemId==1){

    }
})
